package user_api

import (
	"fastgin/global"
	"fastgin/service/redis_ser"
	"fastgin/utils/res"

	"github.com/gin-gonic/gin"
)

func (UserApi) LogoutView(c *gin.Context) {
	token := c.GetHeader("token")
	if global.Redis == nil {
		res.OkWithMsg("用户注销成功", c)
		return
	}

	redis_ser.Logout(token)
	res.OkWithMsg("用户注销成功", c)
}
